package com.nbsaas.boot.quartz.data.entity;

import com.nbsaas.boot.code.annotation.FieldConvert;
import com.nbsaas.boot.code.annotation.FieldName;
import com.nbsaas.boot.code.annotation.FormAnnotation;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.*;
import lombok.Data;
import org.hibernate.annotations.Comment;

@FormAnnotation(title = "定时任务记录", model = "定时任务记录")
@Comment("定时任务记录")
@Data
@Entity
@Table(name = "nb_scheduling_task_record")
public class SchedulingTaskRecord extends AbstractEntity {


    @Comment("任务id")
    @JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    @FieldName
    @FieldConvert
    @ManyToOne(fetch = FetchType.LAZY)
    private SchedulingTask schedulingTask;


    @Comment("执行状态 1成功，2失败")
    private Integer state;

    @Comment("任务执行完返回的结果")
    private String note;


}